Optimal. Leaf size=156 \[ \frac {13 \sqrt {a} \tanh ^{-1}\left (\frac {\sqrt {a} \cos (c+d x)}{\sqrt {a+a \sin (c+d x)}}\right )}{4 d}-\frac {2 a \cos (c+d x)}{3 d \sqrt {a+a \sin (c+d x)}}-\frac {a \cot (c+d x)}{4 d \sqrt {a+a \sin (c+d x)}}-\frac {2 \cos (c+d x) \sqrt {a+a \sin (c+d x)}}{3 d}-\frac {\cot (c+d x) \csc (c+d x) \sqrt {a+a \sin (c+d x)}}{2 d} \]
[Out]
________________________________________________________________________________________
Rubi [A]
time = 0.26, antiderivative size = 156, normalized size of antiderivative = 1.00, number of steps
used = 7, number of rules used = 7, integrand size = 29, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.241, Rules used = {2960, 2830,
2725, 3123, 3059, 2852, 212} \begin {gather*} -\frac {2 \cos (c+d x) \sqrt {a \sin (c+d x)+a}}{3 d}-\frac {2 a \cos (c+d x)}{3 d \sqrt {a \sin (c+d x)+a}}-\frac {a \cot (c+d x)}{4 d \sqrt {a \sin (c+d x)+a}}+\frac {13 \sqrt {a} \tanh ^{-1}\left (\frac {\sqrt {a} \cos (c+d x)}{\sqrt {a \sin (c+d x)+a}}\right )}{4 d}-\frac {\cot (c+d x) \csc (c+d x) \sqrt {a \sin (c+d x)+a}}{2 d} \end {gather*}
Antiderivative was successfully verified.
[In]
[Out]
Rule 212
Rule 2725
Rule 2830
Rule 2852
Rule 2960
Rule 3059
Rule 3123
Rubi steps
\begin {align*} \int \cos (c+d x) \cot ^3(c+d x) \sqrt {a+a \sin (c+d x)} \, dx &=\int \sin (c+d x) \sqrt {a+a \sin (c+d x)} \, dx+\int \csc ^3(c+d x) \sqrt {a+a \sin (c+d x)} \left (1-2 \sin ^2(c+d x)\right ) \, dx\\ &=-\frac {2 \cos (c+d x) \sqrt {a+a \sin (c+d x)}}{3 d}-\frac {\cot (c+d x) \csc (c+d x) \sqrt {a+a \sin (c+d x)}}{2 d}+\frac {1}{3} \int \sqrt {a+a \sin (c+d x)} \, dx+\frac {\int \csc ^2(c+d x) \left (\frac {a}{2}-\frac {7}{2} a \sin (c+d x)\right ) \sqrt {a+a \sin (c+d x)} \, dx}{2 a}\\ &=-\frac {2 a \cos (c+d x)}{3 d \sqrt {a+a \sin (c+d x)}}-\frac {a \cot (c+d x)}{4 d \sqrt {a+a \sin (c+d x)}}-\frac {2 \cos (c+d x) \sqrt {a+a \sin (c+d x)}}{3 d}-\frac {\cot (c+d x) \csc (c+d x) \sqrt {a+a \sin (c+d x)}}{2 d}-\frac {13}{8} \int \csc (c+d x) \sqrt {a+a \sin (c+d x)} \, dx\\ &=-\frac {2 a \cos (c+d x)}{3 d \sqrt {a+a \sin (c+d x)}}-\frac {a \cot (c+d x)}{4 d \sqrt {a+a \sin (c+d x)}}-\frac {2 \cos (c+d x) \sqrt {a+a \sin (c+d x)}}{3 d}-\frac {\cot (c+d x) \csc (c+d x) \sqrt {a+a \sin (c+d x)}}{2 d}+\frac {(13 a) \text {Subst}\left (\int \frac {1}{a-x^2} \, dx,x,\frac {a \cos (c+d x)}{\sqrt {a+a \sin (c+d x)}}\right )}{4 d}\\ &=\frac {13 \sqrt {a} \tanh ^{-1}\left (\frac {\sqrt {a} \cos (c+d x)}{\sqrt {a+a \sin (c+d x)}}\right )}{4 d}-\frac {2 a \cos (c+d x)}{3 d \sqrt {a+a \sin (c+d x)}}-\frac {a \cot (c+d x)}{4 d \sqrt {a+a \sin (c+d x)}}-\frac {2 \cos (c+d x) \sqrt {a+a \sin (c+d x)}}{3 d}-\frac {\cot (c+d x) \csc (c+d x) \sqrt {a+a \sin (c+d x)}}{2 d}\\ \end {align*}
________________________________________________________________________________________
Mathematica [A]
time = 0.74, size = 297, normalized size = 1.90 \begin {gather*} \frac {\csc ^7\left (\frac {1}{2} (c+d x)\right ) \sqrt {a (1+\sin (c+d x))} \left (-26 \cos \left (\frac {1}{2} (c+d x)\right )-14 \cos \left (\frac {3}{2} (c+d x)\right )+12 \cos \left (\frac {5}{2} (c+d x)\right )+4 \cos \left (\frac {7}{2} (c+d x)\right )+39 \log \left (1+\cos \left (\frac {1}{2} (c+d x)\right )-\sin \left (\frac {1}{2} (c+d x)\right )\right )-39 \cos (2 (c+d x)) \log \left (1+\cos \left (\frac {1}{2} (c+d x)\right )-\sin \left (\frac {1}{2} (c+d x)\right )\right )-39 \log \left (1-\cos \left (\frac {1}{2} (c+d x)\right )+\sin \left (\frac {1}{2} (c+d x)\right )\right )+39 \cos (2 (c+d x)) \log \left (1-\cos \left (\frac {1}{2} (c+d x)\right )+\sin \left (\frac {1}{2} (c+d x)\right )\right )+26 \sin \left (\frac {1}{2} (c+d x)\right )-14 \sin \left (\frac {3}{2} (c+d x)\right )-12 \sin \left (\frac {5}{2} (c+d x)\right )+4 \sin \left (\frac {7}{2} (c+d x)\right )\right )}{12 d \left (1+\cot \left (\frac {1}{2} (c+d x)\right )\right ) \left (\csc ^2\left (\frac {1}{4} (c+d x)\right )-\sec ^2\left (\frac {1}{4} (c+d x)\right )\right )^2} \end {gather*}
Antiderivative was successfully verified.
[In]
[Out]
________________________________________________________________________________________
Maple [A]
time = 5.88, size = 178, normalized size = 1.14
method | result | size |
default | \(\frac {\left (1+\sin \left (d x +c \right )\right ) \sqrt {-a \left (\sin \left (d x +c \right )-1\right )}\, \left (8 \left (-a \left (\sin \left (d x +c \right )-1\right )\right )^{\frac {3}{2}} \left (\sin ^{2}\left (d x +c \right )\right ) \sqrt {a}-24 \sqrt {-a \left (\sin \left (d x +c \right )-1\right )}\, a^{\frac {3}{2}} \left (\sin ^{2}\left (d x +c \right )\right )+39 \arctanh \left (\frac {\sqrt {-a \left (\sin \left (d x +c \right )-1\right )}}{\sqrt {a}}\right ) a^{2} \left (\sin ^{2}\left (d x +c \right )\right )+9 \left (-a \left (\sin \left (d x +c \right )-1\right )\right )^{\frac {3}{2}} \sqrt {a}-15 \sqrt {-a \left (\sin \left (d x +c \right )-1\right )}\, a^{\frac {3}{2}}\right )}{12 a^{\frac {3}{2}} \sin \left (d x +c \right )^{2} \cos \left (d x +c \right ) \sqrt {a +a \sin \left (d x +c \right )}\, d}\) | \(178\) |
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Maxima [F]
time = 0.00, size = 0, normalized size = 0.00 \begin {gather*} \text {Failed to integrate} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Fricas [B] Leaf count of result is larger than twice the leaf count of optimal. 359 vs.
\(2 (132) = 264\).
time = 0.38, size = 359, normalized size = 2.30 \begin {gather*} \frac {39 \, {\left (\cos \left (d x + c\right )^{3} + \cos \left (d x + c\right )^{2} + {\left (\cos \left (d x + c\right )^{2} - 1\right )} \sin \left (d x + c\right ) - \cos \left (d x + c\right ) - 1\right )} \sqrt {a} \log \left (\frac {a \cos \left (d x + c\right )^{3} - 7 \, a \cos \left (d x + c\right )^{2} + 4 \, {\left (\cos \left (d x + c\right )^{2} + {\left (\cos \left (d x + c\right ) + 3\right )} \sin \left (d x + c\right ) - 2 \, \cos \left (d x + c\right ) - 3\right )} \sqrt {a \sin \left (d x + c\right ) + a} \sqrt {a} - 9 \, a \cos \left (d x + c\right ) + {\left (a \cos \left (d x + c\right )^{2} + 8 \, a \cos \left (d x + c\right ) - a\right )} \sin \left (d x + c\right ) - a}{\cos \left (d x + c\right )^{3} + \cos \left (d x + c\right )^{2} + {\left (\cos \left (d x + c\right )^{2} - 1\right )} \sin \left (d x + c\right ) - \cos \left (d x + c\right ) - 1}\right ) - 4 \, {\left (8 \, \cos \left (d x + c\right )^{4} + 16 \, \cos \left (d x + c\right )^{3} - 9 \, \cos \left (d x + c\right )^{2} + {\left (8 \, \cos \left (d x + c\right )^{3} - 8 \, \cos \left (d x + c\right )^{2} - 17 \, \cos \left (d x + c\right ) + 5\right )} \sin \left (d x + c\right ) - 22 \, \cos \left (d x + c\right ) - 5\right )} \sqrt {a \sin \left (d x + c\right ) + a}}{48 \, {\left (d \cos \left (d x + c\right )^{3} + d \cos \left (d x + c\right )^{2} - d \cos \left (d x + c\right ) + {\left (d \cos \left (d x + c\right )^{2} - d\right )} \sin \left (d x + c\right ) - d\right )}} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Sympy [F(-2)]
time = 0.00, size = 0, normalized size = 0.00 \begin {gather*} \text {Exception raised: SystemError} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Giac [A]
time = 0.47, size = 211, normalized size = 1.35 \begin {gather*} -\frac {\sqrt {2} {\left (64 \, \mathrm {sgn}\left (\cos \left (-\frac {1}{4} \, \pi + \frac {1}{2} \, d x + \frac {1}{2} \, c\right )\right ) \sin \left (-\frac {1}{4} \, \pi + \frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{3} - 39 \, \sqrt {2} \log \left (\frac {{\left | -2 \, \sqrt {2} + 4 \, \sin \left (-\frac {1}{4} \, \pi + \frac {1}{2} \, d x + \frac {1}{2} \, c\right ) \right |}}{{\left | 2 \, \sqrt {2} + 4 \, \sin \left (-\frac {1}{4} \, \pi + \frac {1}{2} \, d x + \frac {1}{2} \, c\right ) \right |}}\right ) \mathrm {sgn}\left (\cos \left (-\frac {1}{4} \, \pi + \frac {1}{2} \, d x + \frac {1}{2} \, c\right )\right ) - 96 \, \mathrm {sgn}\left (\cos \left (-\frac {1}{4} \, \pi + \frac {1}{2} \, d x + \frac {1}{2} \, c\right )\right ) \sin \left (-\frac {1}{4} \, \pi + \frac {1}{2} \, d x + \frac {1}{2} \, c\right ) + \frac {12 \, {\left (6 \, \mathrm {sgn}\left (\cos \left (-\frac {1}{4} \, \pi + \frac {1}{2} \, d x + \frac {1}{2} \, c\right )\right ) \sin \left (-\frac {1}{4} \, \pi + \frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{3} - 5 \, \mathrm {sgn}\left (\cos \left (-\frac {1}{4} \, \pi + \frac {1}{2} \, d x + \frac {1}{2} \, c\right )\right ) \sin \left (-\frac {1}{4} \, \pi + \frac {1}{2} \, d x + \frac {1}{2} \, c\right )\right )}}{{\left (2 \, \sin \left (-\frac {1}{4} \, \pi + \frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{2} - 1\right )}^{2}}\right )} \sqrt {a}}{48 \, d} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Mupad [F]
time = 0.00, size = -1, normalized size = -0.01 \begin {gather*} \int \frac {{\cos \left (c+d\,x\right )}^4\,\sqrt {a+a\,\sin \left (c+d\,x\right )}}{{\sin \left (c+d\,x\right )}^3} \,d x \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________